import React from 'react'
import {Icon} from 'antd';
import FBHeaderView from '../../component/form-header/View';
import {WeaInput, WeaInputLocale, WeaLocaleProvider} from "ecCom";
import isMobile from "../../../../../utils/mobileDetect";
const getMultiStrFromBase64 = WeaInputLocale.getMultiStrFromBase64;
const formatMultiLang = WeaLocaleProvider.formatMultiLang;

const isMobileView = isMobile();

export default class Success extends React.Component {
  render() {
    let { title, successMessage, showHeader, top } = this.props;
    top = isMobileView ? top + 20 : top;

    return (
      <div className='wea-edc-success-box' style={{ paddingTop: top}}>
        { showHeader ?
          <FBHeaderView data={{}} /> : null
        }
        <div className='wea-edc-success-content'>
          <div style={{ color: '#71B300', fontSize: 50 }}><Icon type="check-circle" /></div>
          <div style={{ fontSize: 18, paddingBottom: 3 }}>{formatMultiLang(title)}</div>
          <WeaInput  isBase64={true} inputType={"multilang"} value={getMultiStrFromBase64(successMessage)} viewAttr={1} />
        </div>
      </div>
    )
  }
}